home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 1998 November / IRIX 6.5.2 Base Documentation November 1998.img / usr / share / catman / p_man / cat3 / recno.z / recno
Text File  |  1998-10-20  |  8KB  |  199 lines

  1.  
  2.  
  3.  
  4.      RRRREEEECCCCNNNNOOOO((((3333))))         UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV ((((AAAAuuuugggguuuusssstttt 11118888,,,, 1111999999994444))))         RRRREEEECCCCNNNNOOOO((((3333))))
  5.  
  6.  
  7.  
  8.      NNNNAAAAMMMMEEEE
  9.           recno - record number database access method
  10.  
  11.      SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.           ####iiiinnnncccclllluuuuddddeeee <<<<ssssyyyyssss////ttttyyyyppppeeeessss....hhhh>>>>
  13.           ####iiiinnnncccclllluuuuddddeeee <<<<ddddbbbb....hhhh>>>>
  14.  
  15.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  16.           The routine _d_b_o_p_e_n is the library interface to database
  17.           files.  One of the supported file formats is record number
  18.           files.  The general description of the database access
  19.           methods is in _d_b_o_p_e_n(3), this manual page describes only the
  20.           recno specific information.
  21.  
  22.           The record number data structure is either variable or
  23.           fixed-length records stored in a flat-file format, accessed
  24.           by the logical record number.  The existence of record
  25.           number five implies the existence of records one through
  26.           four, and the deletion of record number one causes record
  27.           number five to be renumbered to record number four, as well
  28.           as the cursor, if positioned after record number one, to
  29.           shift down one record.
  30.  
  31.           The recno access method specific data structure provided to
  32.           _d_b_o_p_e_n is defined in the <db.h> include file as follows:
  33.  
  34.           typedef struct {
  35.                u_long flags;
  36.                u_int cachesize;
  37.                u_int psize;
  38.                int lorder;
  39.                size_t reclen;
  40.                u_char bval;
  41.                char *bfname;
  42.           } RECNOINFO;
  43.  
  44.           The elements of this structure are defined as follows:
  45.  
  46.           flags
  47.                The flag value is specified by _o_r'ing any of the
  48.                following values:
  49.  
  50.                R_FIXEDLEN
  51.                     The records are fixed-length, not byte delimited.
  52.                     The structure element _r_e_c_l_e_n specifies the length
  53.                     of the record, and the structure element _b_v_a_l is
  54.                     used as the pad character.  Any records, inserted
  55.                     into the database, that are less than _r_e_c_l_e_n bytes
  56.                     long are automatically padded.
  57.  
  58.                R_NOKEY
  59.                     In the interface specified by _d_b_o_p_e_n, the
  60.  
  61.  
  62.  
  63.      Page 1                                          (printed 4/30/98)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      RRRREEEECCCCNNNNOOOO((((3333))))         UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV ((((AAAAuuuugggguuuusssstttt 11118888,,,, 1111999999994444))))         RRRREEEECCCCNNNNOOOO((((3333))))
  71.  
  72.  
  73.  
  74.                     sequential record retrieval fills in both the
  75.                     caller's key and data structures.  If the R_NOKEY
  76.                     flag is specified, the _c_u_r_s_o_r routines are not
  77.                     required to fill in the key structure.  This
  78.                     permits applications to retrieve records at the
  79.                     end of files without reading all of the
  80.                     intervening records.
  81.  
  82.                R_SNAPSHOT
  83.                     This flag requires that a snapshot of the file be
  84.                     taken when _d_b_o_p_e_n is called, instead of permitting
  85.                     any unmodified records to be read from the
  86.                     original file.
  87.  
  88.           cachesize
  89.                A suggested maximum size, in bytes, of the memory
  90.                cache.  This value is oooonnnnllllyyyy advisory, and the access
  91.                method will allocate more memory rather than fail.  If
  92.                _c_a_c_h_e_s_i_z_e is  0 (no size is specified) a default cache
  93.                is used.
  94.  
  95.           psize
  96.                The recno access method stores the in-memory copies of
  97.                its records in a btree.  This value is the size (in
  98.                bytes) of the pages used for nodes in that tree.  If
  99.                _p_s_i_z_e is 0 (no page size is specified) a page size is
  100.                chosen based on the underlying file system I/O block
  101.                size.  See _b_t_r_e_e(3) for more information.
  102.  
  103.           lorder
  104.                The byte order for integers in the stored database
  105.                metadata.  The number should represent the order as an
  106.                integer; for example, big endian order would be the
  107.                number 4,321.  If _l_o_r_d_e_r is 0 (no order is specified)
  108.                the current host order is used.
  109.  
  110.           reclen
  111.                The length of a fixed-length record.
  112.  
  113.           bval The delimiting byte to be used to mark the end of a
  114.                record for variable-length records, and the pad
  115.                character for fixed-length records.  If no value is
  116.                specified, newlines (``\n'') are used to mark the end
  117.                of variable-length records and fixed-length records are
  118.                padded with spaces.
  119.  
  120.           bfname
  121.                The recno access method stores the in-memory copies of
  122.                its records in a btree.  If bfname is non-NULL, it
  123.                specifies the name of the btree file, as if specified
  124.                as the file name for a dbopen of a btree file.
  125.  
  126.  
  127.  
  128.  
  129.      Page 2                                          (printed 4/30/98)
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.      RRRREEEECCCCNNNNOOOO((((3333))))         UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV ((((AAAAuuuugggguuuusssstttt 11118888,,,, 1111999999994444))))         RRRREEEECCCCNNNNOOOO((((3333))))
  137.  
  138.  
  139.  
  140.           The data part of the key/data pair used by the recno access
  141.           method is the same as other access methods.  The key is
  142.           different.  The _d_a_t_a field of the key should be a pointer to
  143.           a memory location of type _r_e_c_n_o__t, as defined in the <db.h>
  144.           include file.  This type is normally the largest unsigned
  145.           integral type available to the implementation.  The _s_i_z_e
  146.           field of the key should be the size of that type.
  147.  
  148.           Because there can be no meta-data associated with the
  149.           underlying recno access method files, any changes made to
  150.           the default values (e.g. fixed record length or byte
  151.           separator value) must be explicitly specified each time the
  152.           file is opened.
  153.  
  154.           In the interface specified by _d_b_o_p_e_n, using the _p_u_t
  155.           interface to create a new record will cause the creation of
  156.           multiple, empty records if the record number is more than
  157.           one greater than the largest record currently in the
  158.           database.
  159.  
  160.      EEEERRRRRRRROOOORRRRSSSS
  161.           The _r_e_c_n_o access method routines may fail and set _e_r_r_n_o for
  162.           any of the errors specified for the library routine
  163.           _d_b_o_p_e_n(3) or the following:
  164.  
  165.           [EINVAL]
  166.                An attempt was made to add a record to a fixed-length
  167.                database that was too large to fit.
  168.  
  169.      SSSSEEEEEEEE AAAALLLLSSSSOOOO
  170.           _b_t_r_e_e(3) _d_b_o_p_e_n(3), _h_a_s_h(3), _m_p_o_o_l(3),
  171.  
  172.           _D_o_c_u_m_e_n_t _P_r_o_c_e_s_s_i_n_g _i_n _a _R_e_l_a_t_i_o_n_a_l _D_a_t_a_b_a_s_e _S_y_s_t_e_m, Michael
  173.           Stonebraker, Heidi Stettner, Joseph Kalash, Antonin Guttman,
  174.           Nadene Lynn, Memorandum No. UCB/ERL M82/32, May 1982.
  175.  
  176.      BBBBUUUUGGGGSSSS
  177.           Only big and little endian byte order is supported.
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.      Page 3                                          (printed 4/30/98)
  196.  
  197.  
  198.  
  199.